<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('我的领养申请')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
</head>
<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<script th:inline="javascript">
    var prefix = ctx + "user/pet";

    $(function () {
        var panehHidden = false;
        if ($(this).width() < 769) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 185});
        queryUserList();
    });

    function queryUserList() {
        var options = {
            url: prefix + "/myapply",
            sortName: "createTime",
            sortOrder: "desc",
            modalName: "我的申请",

            columns: [{
                checkbox: true,
            },
                // {
                //     field: 'id',
                //     title: '宠物id',
                // },
                {
                    field: 'petName',
                    title: '宠物名称',
                },
                {
                    field: 'type',
                    title: '宠物类型'
                },
                {
                    field: 'sex',
                    title: '性别',
                    formatter: function (value, item, index) {
                        if (item.sex === 1) {
                            return '雄性';
                        } else {
                            return '雌性';
                        }
                    }
                },
                {
                    field: 'createTime',
                    title: '申请时间',
                    sortable: true
                },
                {
                    field: 'confirm',
                    title: '申请状态',
                    formatter: function (value, item, index) {
                        if (item.confirm === 1) {
                            return  '恭喜你，领养成功！';
                        } else {
                            return '处理中';
                        }
                    }
                }]
        };
        $.table.init(options);
    }


</script>
</body>
</html>